{
 "cells": [
  {
   "cell_type": "raw",
   "id": "0b19416f-038c-4013-a26f-c996f0a21c99",
   "metadata": {
    "raw_mimetype": "text/restructuredtext"
   },
   "source": [
    ".. _nb_df:"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "2edfeec1-ae54-4c3f-ad90-a15f888d6278",
   "metadata": {},
   "source": [
    "## DF: Benchmark Problems for CEC2018 Competition on Dynamic Multiobjective Optimisation\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "40fae782-47ad-4d4b-bca2-82f96f2050d4",
   "metadata": {},
   "source": [
    "The problem suite is implemented based on <cite data-cite=\"df\"></cite>."
   ]
  },
  {
   "cell_type": "raw",
   "id": "1ff63dec-92f8-4627-b398-6afbbb146d61",
   "metadata": {
    "raw_mimetype": "text/restructuredtext"
   },
   "source": [
    ".. _nb_df1:"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "3f3592a5-26d4-4740-bb2d-0ad3ba891efa",
   "metadata": {},
   "source": [
    "### DF1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "cc2a8e46-9611-4786-9c46-fd53378f16b2",
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "\n",
    "from pymoo.problems.dynamic.df import DF1\n",
    "from pymoo.visualization.scatter import Scatter\n",
    "\n",
    "plot = Scatter()\n",
    "\n",
    "for t in np.linspace(0, 10.0, 100):\n",
    "    problem = DF1(time=t)\n",
    "    plot.add(problem.pareto_front(), plot_type=\"line\", color=\"black\", alpha=0.7)\n",
    "\n",
    "plot.show()"
   ]
  },
  {
   "cell_type": "raw",
   "id": "7cdfca4b-e260-4456-866d-4db79a4dae4f",
   "metadata": {
    "raw_mimetype": "text/restructuredtext"
   },
   "source": [
    ".. _nb_df2:"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "415aea8e-1476-4ca3-81ee-d5864761cd5b",
   "metadata": {},
   "source": [
    "### DF2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "ad09fb5c-2a66-46fc-b17f-63ca86ca6ca5",
   "metadata": {},
   "outputs": [],
   "source": [
    "from pymoo.problems.dynamic.df import DF2\n",
    "\n",
    "plot = Scatter()\n",
    "\n",
    "for t in np.linspace(0, 10.0, 100):\n",
    "    problem = DF2(time=t)\n",
    "    plot.add(problem.pareto_front(), plot_type=\"line\", color=\"black\", alpha=0.7)\n",
    "\n",
    "plot.show()"
   ]
  },
  {
   "cell_type": "raw",
   "id": "a496b361-ffe6-45aa-86c9-f607db96acfa",
   "metadata": {
    "raw_mimetype": "text/restructuredtext"
   },
   "source": [
    ".. _nb_df3:"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "9e3c0881-62a5-442b-bec3-5d0f6ca21fd1",
   "metadata": {},
   "source": [
    "### DF3"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "2d143d62-3d39-4329-8358-f3b44b937081",
   "metadata": {},
   "outputs": [],
   "source": [
    "from pymoo.problems.dynamic.df import DF3\n",
    "\n",
    "plot = Scatter()\n",
    "\n",
    "for t in np.linspace(0, 10.0, 100):\n",
    "    problem = DF3(time=t)\n",
    "    plot.add(problem.pareto_front(), plot_type=\"line\", color=\"black\", alpha=0.7)\n",
    "\n",
    "plot.show()"
   ]
  },
  {
   "cell_type": "raw",
   "id": "c9a068fa-e717-4eb7-939c-5d4cec944dc6",
   "metadata": {
    "raw_mimetype": "text/restructuredtext"
   },
   "source": [
    ".. _nb_df4:"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "22fd7f56-b5ad-4e48-aed7-c12733cdf339",
   "metadata": {},
   "source": [
    "### DF4"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "6ef691c9-cf12-4b22-94b0-b3c576745be2",
   "metadata": {},
   "outputs": [],
   "source": [
    "from pymoo.problems.dynamic.df import DF4\n",
    "\n",
    "plot = Scatter()\n",
    "\n",
    "for t in np.linspace(0, 10.0, 100):\n",
    "    problem = DF4(time=t)\n",
    "    plot.add(problem.pareto_front() + 2*t, plot_type=\"line\", color=\"black\", alpha=0.7)\n",
    "\n",
    "plot.show()"
   ]
  },
  {
   "cell_type": "raw",
   "id": "e5f0fef8-b281-4631-82b8-6641d45cacd2",
   "metadata": {
    "raw_mimetype": "text/restructuredtext"
   },
   "source": [
    ".. _nb_df5:"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "31950ce1-af9c-4dde-91d8-332dacce0a98",
   "metadata": {},
   "source": [
    "### DF5"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "562a58b8-b1ec-4994-b912-41720ed97702",
   "metadata": {},
   "outputs": [],
   "source": [
    "from pymoo.problems.dynamic.df import DF5\n",
    "\n",
    "plot = Scatter()\n",
    "\n",
    "for t in np.linspace(0, 2.0, 100):\n",
    "    problem = DF5(time=t)\n",
    "    plot.add(problem.pareto_front(n_pareto_points=300) + 2*t, plot_type=\"line\", color=\"black\", alpha=0.7)\n",
    "\n",
    "plot.show()"
   ]
  },
  {
   "cell_type": "raw",
   "id": "6ec043e6-eb79-46c4-a1b3-6d3fecaf0511",
   "metadata": {
    "raw_mimetype": "text/restructuredtext"
   },
   "source": [
    ".. _nb_df6:"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "871df007-92f4-4202-86e9-9ca9fd16d0fc",
   "metadata": {},
   "source": [
    "### DF6"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "d92b7233-345e-4eaa-a736-e22e1f0006cc",
   "metadata": {},
   "outputs": [],
   "source": [
    "from pymoo.problems.dynamic.df import DF6\n",
    "\n",
    "plot = Scatter()\n",
    "\n",
    "for t in np.linspace(0, 2.0, 100):\n",
    "    problem = DF6(time=t)\n",
    "    plot.add(problem.pareto_front(), plot_type=\"line\", color=\"black\", alpha=0.7)\n",
    "\n",
    "plot.show()"
   ]
  },
  {
   "cell_type": "raw",
   "id": "64a0e30e-104d-4624-abaa-f750075c2f92",
   "metadata": {
    "raw_mimetype": "text/restructuredtext"
   },
   "source": [
    ".. _nb_df7:"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "50eca906-9338-40c6-9588-8f4fc8adefaf",
   "metadata": {},
   "source": [
    "### DF7"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "4444cf90-d3cd-438f-b8b1-33931e7b85d4",
   "metadata": {},
   "outputs": [],
   "source": [
    "from pymoo.problems.dynamic.df import DF7\n",
    "\n",
    "plot = Scatter()\n",
    "\n",
    "for t in np.linspace(0, 1.0, 20):\n",
    "    problem = DF7(time=t)\n",
    "    plot.add(problem.pareto_front() + 2*t, plot_type=\"line\", color=\"black\", alpha=0.7)\n",
    "\n",
    "plot.show()"
   ]
  },
  {
   "cell_type": "raw",
   "id": "fe4a71ab-e9fa-448a-b734-73bb7f7d2506",
   "metadata": {
    "raw_mimetype": "text/restructuredtext"
   },
   "source": [
    ".. _nb_df8:"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "ed46a73d-1a29-4bd4-8110-3f235fdac6a5",
   "metadata": {},
   "source": [
    "### DF8"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "35553c26-8991-4bf5-be70-be3c5e0ef1af",
   "metadata": {},
   "outputs": [],
   "source": [
    "from pymoo.problems.dynamic.df import DF8\n",
    "\n",
    "plot = Scatter()\n",
    "\n",
    "for t in np.linspace(0, 2.0, 20):\n",
    "    problem = DF8(time=t)\n",
    "    plot.add(problem.pareto_front() + 4*t, plot_type=\"line\", color=\"black\", alpha=0.7)\n",
    "\n",
    "plot.show()"
   ]
  },
  {
   "cell_type": "raw",
   "id": "ee324a14-d36f-46f1-a169-dc01a917833b",
   "metadata": {
    "raw_mimetype": "text/restructuredtext"
   },
   "source": [
    ".. _nb_df9:"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "51186980-2e7b-4846-bd2b-7128726d1c23",
   "metadata": {},
   "source": [
    "### DF9"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "64d62bcd-fd1f-4cd9-ae02-327297d3389d",
   "metadata": {},
   "outputs": [],
   "source": [
    "from pymoo.problems.dynamic.df import DF9\n",
    "\n",
    "plot = Scatter()\n",
    "\n",
    "for t in np.linspace(0, 2.0, 20):\n",
    "    problem = DF9(time=t)\n",
    "    plot.add(problem.pareto_front() + 2*t, plot_type=\"line\", color=\"black\", alpha=0.7)\n",
    "\n",
    "plot.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "f1ef8744-cc6b-4c8d-99ba-09d54900cdb7",
   "metadata": {},
   "source": [
    "### DF10"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "9acd5bd6-5296-4edb-9eba-a9438ab495de",
   "metadata": {},
   "outputs": [],
   "source": [
    "from pymoo.problems.dynamic.df import DF10\n",
    "import matplotlib.pyplot as plt\n",
    "\n",
    "for t in [0.0, 1.0, 1.5, 2.0]:\n",
    "    \n",
    "    plot = Scatter()\n",
    "    problem = DF10(time=t)\n",
    "    plot.add(problem.pareto_front() + 2*t, plot_type=\"line\", color=\"black\", alpha=0.7)\n",
    "    plot.do()\n",
    "    plt.show()\n",
    "    \n",
    "print(\"DONE\")"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "c8de57b2-9357-4a6e-b082-5a5fa49aa2c9",
   "metadata": {},
   "source": [
    "### DF11"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "c8b384b7-878c-4b5a-b991-a96256ae6847",
   "metadata": {},
   "outputs": [],
   "source": [
    "from pymoo.problems.dynamic.df import DF11\n",
    "import matplotlib.pyplot as plt\n",
    "\n",
    "for t in [0.0, 1.0, 1.5, 2.0]:\n",
    "    \n",
    "    plot = Scatter()\n",
    "    problem = DF11(time=t)\n",
    "    plot.add(problem.pareto_front() + 2*t, plot_type=\"line\", color=\"black\", alpha=0.7)\n",
    "    plot.do()\n",
    "    plt.show()\n",
    "    \n",
    "print(\"DONE\")"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "5eac291d-ef10-4e0b-910b-580aa90cdb35",
   "metadata": {},
   "source": [
    "### DF12"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "3140e251-eb2a-4f45-8582-50d863aaa3a9",
   "metadata": {},
   "outputs": [],
   "source": [
    "from pymoo.problems.dynamic.df import DF12\n",
    "import matplotlib.pyplot as plt\n",
    "\n",
    "for t in [0.0, 0.1, 0.2]:\n",
    "    \n",
    "    plot = Scatter()\n",
    "    problem = DF12(time=t)\n",
    "    plot.add(problem.pareto_front() + 2*t, color=\"black\", alpha=0.7)\n",
    "    plot.do()\n",
    "    plt.show()\n",
    "    \n",
    "print(\"DONE\")"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "8d152672-a9bc-4e47-9fbf-250b6a50e5f0",
   "metadata": {
    "tags": []
   },
   "source": [
    "### DF13"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "4bb1f484-6063-4b69-b286-949a6da67263",
   "metadata": {},
   "outputs": [],
   "source": [
    "from pymoo.problems.dynamic.df import DF13\n",
    "import matplotlib.pyplot as plt\n",
    "\n",
    "for t in [0.0, 0.2, 0.3, 0.4]:\n",
    "    \n",
    "    plot = Scatter()\n",
    "    problem = DF13(time=t)\n",
    "    plot.add(problem.pareto_front() + 2*t, color=\"black\", alpha=0.7)\n",
    "    plot.do()\n",
    "    plt.show()\n",
    "    \n",
    "print(\"DONE\")"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "f64515d8-5e91-4205-ab11-99d9b65ffb62",
   "metadata": {
    "tags": []
   },
   "source": [
    "### DF14"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "b1625ff5-9094-4e74-bc01-919972180976",
   "metadata": {},
   "outputs": [],
   "source": [
    "from pymoo.problems.dynamic.df import DF14\n",
    "import matplotlib.pyplot as plt\n",
    "\n",
    "for t in [0.0, 0.2, 0.5, 1.0]:\n",
    "    \n",
    "    plot = Scatter()\n",
    "    problem = DF13(time=t)\n",
    "    plot.add(problem.pareto_front() + 2*t, color=\"black\", alpha=0.7)\n",
    "    plot.do()\n",
    "    plt.show()\n",
    "    \n",
    "print(\"DONE\")"
   ]
  }
 ],
 "metadata": {
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
